import 'dart:convert';

import 'package:enterprise_v6_app/app/data/common/tree_node_bean.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/communication_personnel_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/communicate_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/communicate_entity.g.dart';

/// 通讯节点实体
@JsonSerializable()
class CommunicateEntity implements TreeNodeBean<CommunicationPersonnelEntity, CommunicateEntity> {
  CommunicateEntity();

  factory CommunicateEntity.fromJson(Map<String, dynamic> json) => $CommunicateEntityFromJson(json);
  late String companyCode = '';
  late String createBy = '';
  late String createById = '';
  late String createDate = '';
  late String deleted = '';
  late String exercisePlanName = '';
  late String id = '';
  late String parentId = '';
  late int type = 0;
  late String updateBy = '';
  late String updateById = '';
  late String updateDate = '';

  Map<String, dynamic> toJson() => $CommunicateEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  late List<CommunicateEntity> children = [];

  @override
  late bool isExpand = false;

  @override
  late bool isSelected = false;

  @override
  late List<CommunicationPersonnelEntity> userList = [];

  @override
  String getId() {
    return id;
  }

  @override
  String getShowName() {
    return exercisePlanName;
  }
}
